package com.example.springboot.controller.requestLimit;

import com.example.springboot.config.anotation.requstlimit.RequestLimit;
import com.example.springboot.pojo.CodeEnum;
import com.example.springboot.pojo.ResultData;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试对对接口限流
 *
 * @Author:ChenZhangKun
 * @Date: 2021/7/29 10:52
 */
@RestController
@RequestMapping("/limit")
public class RequestLimitController {
    @GetMapping("/get")
    @RequestLimit(count = 3,seconds = 10)
    public ResultData resultData() {
        ResultData resultData = new ResultData(CodeEnum.SUCCESS.getCode(), "请求成功");
        return resultData;
    }
}
